import request from "@/services/request.ts";

export const dictionaryList = async () => {
    return await request.get('/dictionary')
}

// 新增字典数据源
export const dictionaryCreate = async (data:object) => {
    return await request.post('/dictionary',data)
}
//编辑字典数据源
export const dictionaryUpdate = async (id:number,data:object) => {
    return await request.put(`/dictionary/${id}`,data)
}
//批量更新状态
export const dictionaryUpdateStatus = async (id:number[],data:{status:number}) => {
    const ids = id.join(',')
    return await request.put('/dictionary/batch_status',{ids,data})
}
export const dictionaryDelete = async (id:number) => {
    return await request.del(`/dictionary/${id}`)
}
//批量删除
export const dictionaryDeleteBatch = async (id:number[]) => {
    const ids = id.join(',')
    return await request.del('/dictionary/batch_delete',{ids})
}